//
//  HomeRepayTableViewCell.m
//  ATMCash
//
//  Created by zhengchengfeng on 2024/9/7.
//

#import "HomeRepayTableViewCell.h"

@implementation HomeRepayTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backgroundColor = [UIColor clearColor];
        
        UIImage *img = [UIImage imageNamed:@"icon_HomeRepay"];
        
        self.backV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 90)];
        self.backV.backgroundColor = [UIColor clearColor];
        self.backV.userInteractionEnabled = YES;
        [self.contentView addSubview:self.backV];
//        [self.backV mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.left.equalTo(self.contentView.mas_left).offset(0);
//            make.right.equalTo(self.contentView.mas_right).offset(-0);
//            make.top.equalTo(self.contentView.mas_top);
//            make.bottom.equalTo(self.contentView.mas_bottom).offset(-0);
//        }];
        
        
        UIImageView *imgV = [[UIImageView alloc] initWithFrame:CGRectMake(15, 0, kScreenWidth - 30, 90)];
        imgV.backgroundColor = [UIColor clearColor];
        imgV.image = img;
        [self.backV addSubview:imgV];
        imgV.userInteractionEnabled = YES;
//        [imgV mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.right.equalTo(self.backV.mas_right).offset(-15);
//            make.height.equalTo(@(DimensionBaseIphone6(img.size.height)));
//            make.top.equalTo(self.backV.mas_top);
//            make.left.equalTo(@15);
//
//        }];
        self.bannerView = [[BannerRepayView alloc] initWithFrame:CGRectMake(40, 20, kScreenWidth  - 40 - 40, 90 - 40)];
        self.bannerView.backgroundColor = [UIColor clearColor];
        [self.backV addSubview:self.bannerView];
        
    }
    return self;
}


- (void)reloadData:(NSArray *)dataSource{
    kWeakSelf
    self.bannerView.bannerList = dataSource;
    
    self.bannerView.getBannerUrlString = ^(NSString * _Nonnull urlStr) {
        if (weakSelf.callBackBannerReplyBlock) {
            weakSelf.callBackBannerReplyBlock(urlStr);
        }
    };
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
